import 'package:web_socket_channel/io.dart';

enum SocketStatus {
  /// 连接中
  connecting,

  /// 已连接
  connected,

  /// 已断开
  unconnect,
}

class KqWebSocketState {
  /// socket的状态
  SocketStatus socketStatus = SocketStatus.unconnect;

  /// 心跳包的状态
  bool heartStatus = false;

  /// 地址
  String? socketUrl;

  /// 心跳包数据
  dynamic heartPacket;

  /// 心跳维持时间
  int heartClinetTime = 5;

  IOWebSocketChannel? socketChannel;

  /// 重连次数
  int reconnectNum = 0;

  /// 是否主动关闭了通道
  bool isCloseChannel = false;

  KqWebSocketState() {}
}
